ENT.Base = "base_point"
ENT.Type = "point"

function ENT:KeyValue (key, value)
	self[key] = tonumber(value) or value
	if key == "direction" then
		if value == "1" then
			self.fromEnd = true
		else
			self.fromEnd = false
		end
	end
end

function ENT:Think()
	if !GAMEMODE:IsFight() or self.alreadyFired then return end
	
	local remTime = GAMEMODE:GetRoundTimer()
	local doneTime = GAMEMODE:GetRoundLength() - remTime
	if (self.fromEnd and self.time > remTime) or (!self.fromEnd and self.time < doneTime) then
		self:Fire( "FireUser1", "", 0 )
		self.alreadyFired = true
	end
end

function ENT:OnRoundChange()
	if GAMEMODE:IsFight() then self.alreadyFired = false end
end

GAMEMODE:AddEntityHook( "RoundChanged", "inc_wavereached", "OnRoundChange" )